package com.pan.demo.service;


import com.pan.demo.dao.DemoDao;
import com.pan.demo.entity.Animal;
import com.pan.framework.anno.common.MyInject;
import com.pan.framework.anno.server.MyService;

import java.util.List;

@MyService(name = "demoService")
public class DemoServiceImpl implements DemoService{

    @MyInject(name = "demoDao")
    private DemoDao demoDao;

    public DemoServiceImpl(){
    }

    @Override
    public List<Animal> queryAnimal(){
        return demoDao.query();
    }

    @Override
    public Animal queryOneAnimal(){
        Animal animal = demoDao.query().get(0);
//        System.out.println(animal);
        return animal;
    }
}
